package com.auth.controller;


import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author zzq
 * @since 2021-08-24
 */
@RestController
public class TUserController {

    @GetMapping(value = "/r1")
    // @PreAuthorize("hasAuth ority('p1')")//拥有p1权限方可访问此url
    public String r1() {
        //获取用户身份信息
        //UserVO userDTO = (UserVO) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return "访问资源1";
    }

    @GetMapping(value = "/r2")
    // @PreAuthorize("hasAuth ority('p1')")//拥有p1权限方可访问此url
    public String r2() {
        return LocalDateTime.now().toString();
    }


}
